package com.ruoci.redis.canal;

import com.ruoci.redis.entity.Users;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import top.javatool.canal.client.annotation.CanalTable;
import top.javatool.canal.client.handler.EntryHandler;

/**
 * @author yanglingjun
 */
@Slf4j
//@Component
@CanalTable(value = "users")
public class UserHandler implements EntryHandler<Users> {
 
    @Override
    public void insert(Users user) {
        log.info("添加：" + user);
    }
 
    @Override
    public void update(Users before, Users after) {
        log.info("改前：" + before);
        log.info("改后：" + after);

    }
    @Override
    public void delete(Users user) {
        log.info("删除：" + user);
    }
}
